.wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%) scale(1.2);

  .pole {
    position: absolute;
    width: 5px;
    height: 250px;
    left: 50%;
    transform-origin: center top;
    transform: translateX(-50%) rotate(-25deg);
    color: silver;
    background: currentColor;

    &.two {
      transform: translateX(-50%) rotateY(-180deg) rotate(-25deg);
    }

    &:before {
      content: "";
      position: absolute;
      top: -10px;
      left: -7px;
      width: 20px;
      height: 20px;
      border-radius: 100%;
      background: currentColor;
    }

    &:after {
      content: "";
      position: absolute;
      left: 0;
      bottom: 0;
      width: 20px;
      height: 5px;
      transform: translateX(-50%) rotate(25deg);
      background: currentColor;
    }
  }

  .swing {
    position: absolute;
    width: 40px;
    height: 100%;
    left: calc(50% - 20px);

    .human {
      position: absolute;
      width: 40px;
      height: 80px;
      bottom: 5px;
      z-index: -1;

      .top-part {
        position: absolute;
        width: 40px;
        height: 80px;
        bottom: 5px;
        transform-origin: center bottom;

        animation-name: body-animation;
        animation-duration: 0.8s;
        animation-iteration-count: infinite;
        animation-timing-function: ease-in-out;
        animation-direction: alternate;
        .head {
          position: absolute;
          bottom: 40px;
          left: 50%;
          transform: translateX(-50%);
          width: 20px;
          height: 20px;
          background: #d59e7b;
          border-radius: 100%;
          z-index: 2;

          .hair {
            position: absolute;
            top: -5px;
            left: -10px;
            background: black;
            width: 22px;
            height: 44px;
            border-top-right-radius: 0%;
            border-top-left-radius: 100%;
            border-bottom-right-radius: 75%;
            border-bottom-left-radius: 10%;
            z-index: 2;
          }
          
          .fringe {
            position: absolute;
            top: -5px;
            left: 0;
            width: 0px;
            height: 0px;
            border-top: 10px solid black;
            border-bottom: 10px solid black;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-radius: 100%;
            transform: rotate(45deg);
          }

          .eye {
            content: "";
            position: absolute;
            top: 6px;
            right: 2px;
            width: 2px;
            height: 2px;
            background: black;
            border-radius: 100%;
          }

          .mouth {
            position: absolute;
            top: 10px;
            right: 0px;
            width: 0px;
            height: 0px;
            border-top: 3px solid transparent;
            border-bottom: 3px solid transparent;
            border-left: 3px solid transparent;
            border-right: 3px solid white;
            border-radius: 100%;
            transform: rotate(28deg);
          }
        }
        .body {
          position: absolute;
          bottom: 0px;
          left: 50%;
          transform: translateX(-50%);
          background: #ee5130;
          width: 20px;
          height: 40px;
          border-top-left-radius: 20px;
          border-top-right-radius: 20px;

          .hand {
            position: absolute;
            top: 20%;
            left: 10%;

            .hand-one {
              position: absolute;
              transform: rotate(30deg);
              width: 5px;
              height: 15px;
              background: #ee5130;
              box-shadow: 0 -1px 0px 1px rgba(0, 0, 0, 0.2);
              border-top-right-radius: 100%;
              border-top-left-radius: 100%;
            }

            .hand-two {
              background: #d59e7b;
              position: absolute;
              top: 14px;
              left: -6px;
              width: 4px;
              height: 15px;
              transform-origin: center top;
              transform: rotate(-60deg);
              border-top-left-radius: 15px;
            }
          }
        }
      }
      .leg-one {
        position: absolute;
        bottom: 0;
        left: 10px;
        width: 40px;
        height: 10px;
        background: #1973ad;
        border-bottom-left-radius: 20px;
        border-top-right-radius: 20px;
        z-index: -1;
      }
      .leg-two {
        position: absolute;
        width: 40px;
        height: 10px;
        bottom: 5px;
        right: -5px;
        border-top-right-radius: 50%;
        border-bottom-right-radius: 20px;
        background: #1973ad;
        transform-origin: right center;
        transform: rotate(-90deg);

        animation-name: leg-animation;
        animation-duration: 0.8s;
        animation-iteration-count: infinite;
        animation-timing-function: ease-in-out;
        animation-direction: alternate;

        &:after {
          content: "";
          position: absolute;
          left: -5px;
          top: -1px;
          background: silver;
          height: 18px;
          width: 5px;
          border-top-left-radius: 3px;
          border-bottom-right-radius: 50%;
        }
      }
    }

    .swing-rod {
      position: absolute;
      width: 5px;
      height: 200px;
      left: 50%;
      transform: translateX(-50%);
      background: rgb(50, 50, 50);
    }

    .bottom {
      position: absolute;
      width: 100%;
      height: 5px;
      bottom: 0;
      background: saddlebrown;
    }

    transform-origin: center top;
    animation-duration: 0.8s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;

    &:nth-of-type(1) {
      animation-name: swing-1;
    }

    &:nth-of-type(4) {
      animation-name: swing-2;
    }
  }
}

@keyframes swing-1 {
  from { transform: rotate(-35deg); }
  to { transform: rotate(35deg); }
}

@keyframes body-animation {
  from { transform: rotate(-25deg); }
  to { transform: rotate(20deg); }
}

@keyframes leg-animation {
  from {
    bottom: 2px;
    right: -8px;
    transform: rotate(-55deg);
  }
  to {
    bottom: 2px;
    right: 5px;
    transform: rotate(-170deg);
  }
}
